Repository navigation
feat(mobile): page viewer and ContentImage (SUPER-2079) - #7021
saddlepaddle wants to merge 2 commits into
Conversation
A published page opens at /(authenticated)/page/<id> in a WebView loading viewUrl top-level, so the page's origin is first-party: its storage, CSP, and video playback work exactly as on the web, cached by WebKit, with the ticket riding the URL's path (no headers, no cookies). Navigation stays on the page's origin; anything else opens in the browser. The URL is held for the ticket's window so reopening reuses WebKit's cache. ContentImage wraps expo-image with cacheKey = storage key, so a rotated ticket URL is never a fresh download; the image disk cache gets a 512 MB bound at boot, and sign-out clears it. Error copy reuses the desktop viewer's translated messages, so no new catalog strings. Discovery UX (where pages appear on mobile) is deliberately not here.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Linux extraction on CI adds PageViewerScreen.tsx as a second reference on the two reused dashboard.pageViewer ids; regenerate so the committed catalogs match what the check produces.
🚀 Preview Deployment🔗 Preview Links
Preview updates automatically with new commits |
|
Closing this — the mobile page viewer is being handed off to someone else rather than landing on this stack. The branch
Whoever picks this up should know: it is stacked on |
Links
Summary
/(authenticated)/page/<id>loadsviewUrltop-level in a WebView — the page's origin is first-party, so storage, CSP and video playback work exactly as on the web, cached by WebKit. PlusContentImage(disk cache keyed by storage key), a 512 MB boot-time image-cache bound, and sign-out clearing.How It Works
page.get→viewUrlcarries the ticket in its path, so the WebView needs no headers or cookies; the query'sstaleTime(55 min) holds the URL inside the ticket's window so reopening reuses WebKit's cache instead of minting a fresh URL.onShouldStartLoadWithRequestkeeps navigation on the page's own origin and hands anything else to the system browser.allowsInlineMediaPlayback+mediaPlaybackRequiresUserAction={false}are what let<video>inside a page play inline.ContentImagewraps expo-image withcacheKey = storageKey(page.listreturnsthumbnailStorageKey; the files layer returnsstorageKey), so a rotated ticket URL is never a fresh download on cellular.OrganizationAvataradopts it as the first consumer; the pages grid and attachments use it when they land.dashboard.pageViewer.*messages — zero new catalog strings.Manual QA Checklist
/(authenticated)/page/<id>renders a page; a bogus id renders the error state<video>plays inline and seeksTesting
bun run typecheckinapps/mobile— the one error is pre-existing on the base branch (useCloudWorkspaceItems/tags, from main's workspace-tags work; untouched here)packages/i18n checkclean (reused ids)Known Limitations
expo-videointentionally absent: page video plays natively in the WebView; the dependency lands with the attachments UI (decision 10).Summary by cubic
Implements the mobile page viewer at
/(authenticated)/page/<id>, loading published pages top-level in a WebView so the page's origin is first-party and storage, CSP, and inline video playback work as on the web. Also addsContentImage, which caches remote images on disk by storage key instead of URL (SUPER-2079).Page viewer
ContentImage
expo-imagewithcacheKey= storage key, so a rotated ticket URL is never a fresh download.OrganizationAvataris the first consumer; the pages grid and attachments will use it when they land.Written for commit 57b6677. Summary will update on new commits.